home *** CD-ROM | disk | FTP | other *** search
/ Aminet 23 / Aminet 23 (1998)(GTI - Schatztruhe)[!][Feb 1998].iso / Aminet / text / edit / Smartindent.lha / Smartindent / Install < prev    next >
Text File  |  1997-12-14  |  3KB  |  169 lines

  1. ; $VER: 1.0 All rights reserved.
  2.  
  3. (run "c:version >env:_install_smartindent file api/smartindent.api" (safe))
  4. (set smartver (getenv "_install_smartindent"))
  5. (delete "env:_install_smartindent" (safe))
  6.  
  7. (complete 0)
  8. (welcome (cat "\n"
  9.         "C-Code Smart Indention - " smartver "\n"
  10.         "©1997 Matthias Hopf <mshopf@informatik.uni-erlangen.de>\n"
  11.         "Published under the GNU copyleft\n"
  12.         "GoldED Release 4.7.2+ and C-Code setup (envCPP) required.\n"
  13. ))
  14.  
  15. (if (exists "GOLDED:" (NOREQ))
  16.  
  17.     (
  18.     (set vernum (getversion "golded:golded"))
  19.  
  20.     (set ver (/ vernum 65536))
  21.     (set rev (- vernum (* ver 65536)))
  22.  
  23.     (set version (+ (* 10 ver) rev))
  24.  
  25.     (if (< version 47)
  26.  
  27.         (
  28.         (message "\nSorry, GoldED 4.7.2 or better required")
  29.  
  30.         (exit (quiet))
  31.         )
  32.     )
  33.  
  34.     (if (not (exists "golded:api"))
  35.  
  36.         (makedir "golded:api")
  37.     )
  38.  
  39.     ; check whether API client is already installed
  40.     ; (then the registry is probably installed, too)
  41.  
  42.     (if (exists "golded:api/smartindent.api")
  43.         (
  44.          (set updatereg 0)
  45.          (set #updateregmsg (cat "\nUpdate registry?\n"
  46.           "As smartindent was already installed on your computer before, "
  47.           "your registry is prehaps already upto date.\n"))
  48.         )
  49.         (
  50.          (set updatereg 1)
  51.          (set #updateregmsg "\nUpdate registry?\n")
  52.         )
  53.     )
  54.  
  55.     ; install API clients
  56.  
  57.     (copylib
  58.         (prompt "Install API client 'smartindent.api' ?")
  59.         (help @copylib-help)
  60.         (source "api/smartindent.api")
  61.         (dest   "golded:api")
  62.         (confirm)
  63.     )
  64.  
  65.     ; install registry editor (if not yet installed)
  66.  
  67.     (complete 20)
  68.  
  69.     (if (not (exists "golded:tools"))
  70.  
  71.         (makedir "golded:tools")
  72.     )
  73.  
  74.     (if (not (exists "golded:tools/regedit"))
  75.  
  76.         (makedir "golded:tools/regedit")
  77.     )
  78.  
  79.     (copylib
  80.  
  81.         (prompt "Install registry editor ?")
  82.         (source "bin/regedit" )
  83.         (dest   "golded:tools/regedit")
  84.         (confirm)
  85.         (help @copylib-help)
  86.     )
  87.  
  88.     ; update registry
  89.  
  90.     (complete 50)
  91.  
  92.     (set updatereg (askchoice
  93.  
  94.         (prompt #updateregmsg)
  95.  
  96.         (choices
  97.  
  98.         "No,  do not update the registry"
  99.         "Yes, install the new C preferences!"
  100.         )
  101.  
  102.         (default updatereg)
  103.  
  104.         (help @askchoice-help)
  105.     ))
  106.  
  107.     (if (= updatereg 1)
  108.         (
  109.  
  110.          (if (= @language "deutsch")
  111.          (set menu 1)
  112.          (set menu 0)
  113.          )
  114.  
  115.          (set menu (askchoice
  116.  
  117.          (prompt "\nSmartindent mouse menu\n")
  118.  
  119.          (choices
  120.  
  121.              "English"
  122.              "Deutsch"
  123.          )
  124.  
  125.          (default menu)
  126.  
  127.          (help @askchoice-help)
  128.          ))
  129.  
  130.          (complete 80)
  131.  
  132.          (working "Updating registry...")
  133.  
  134.          (if (= menu 0)
  135.  
  136.          (run "golded:tools/regedit/regedit script=install_e.bat")
  137.          )
  138.  
  139.          (if (= menu 1)
  140.  
  141.          (run "golded:tools/regedit/regedit script=install_d.bat")
  142.          )
  143.           (set #done (cat "Installation complete. Please restart GoldED!\n"
  144.                   "May be you now have two C-Code file types. In this case please remove "
  145.                   "the one that is not listed at the top of the list.\n"
  146.                   "May be you also have smartindent.api started twice. In this case please "
  147.                   "remove one of these lines in the API configuration.\n"
  148.                   "You may want to rearrange the mouse menu entries, too.\n"
  149.           ))
  150.         )
  151.         (set #done "Installation complete. Please restart GoldED!\n")
  152.     )
  153.  
  154.     (complete 100)
  155.  
  156.     (user 2)
  157.     (message #done)
  158.     )
  159.  
  160.     (message (cat "\n"
  161.  
  162.     "Please install GoldED before attempting to\n"
  163.     "install this client.                      \n"
  164.     ))
  165. )
  166.  
  167. (exit (quiet))
  168.  
  169.